package com.bjpowernode.db.mapper;

import com.bjpowernode.db.domain.FinanceAccount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
* @author z'x'c
* @description 针对表【u_finance_account(用户财务资金账户表)】的数据库操作Mapper
* @createDate 2023-07-21 21:29:51
* @Entity com.bjpowernode.db.domain.FinanceAccount
*/
public interface FinanceAccountMapper extends BaseMapper<FinanceAccount> {



    //按照userId查询,并上锁
    FinanceAccount selectByUidForUpdate(Integer productId);


    //投资扣除账户余额.
    int reduceAccountMoneyByBid(Integer userId, BigDecimal bidMoney);

    //增加账户资金.
    int addAvaiableMoney(@Param("uid") Integer uid, @Param("bidMoney") BigDecimal bidMoney, @Param("incomeMoney") BigDecimal incomeMoney);




    //充值更新账号余额.
    int addAvaiableMoneyByRecharge(@Param("uid") Integer uid, @Param("rechargeMoney") BigDecimal rechargeMoney);
}




